]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
cleanup: Also replace Params.parse(..., true) with spread
authorFlorian Müllner <fmuellner@gnome.org>
Tue, 17 Dec 2019 19:06:24 +0000 (20:06 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Sat, 17 Feb 2024 11:02:25 +0000 (12:02 +0100)
This is what Params.parse() boils down to when accepting extra
parameters, so we can just as well use standard syntax here.

Part-of: <https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3196>

js/ui/appDisplay.js
js/ui/notificationDaemon.js
js/ui/panelMenu.js

index cb1a41250ad14cbf035039c721c6cc70cc48c4d8..aca6002eb2d74b6970bcee8865c1d42d99739da3 100644 (file)
@@ -21,7 +21,6 @@ import * as ParentalControlsManager from '../misc/parentalControlsManager.js';
 import * as PopupMenu from './popupMenu.js';
 import * as Search from './search.js';
 import * as SwipeTracker from './swipeTracker.js';
-import * as Params from '../misc/params.js';
 import * as SystemActions from '../misc/systemActions.js';
 
 import * as Main from './main.js';
@@ -2986,10 +2985,9 @@ export const AppIcon = GObject.registerClass({
 }, class AppIcon extends AppViewItem {
     _init(app, iconParams = {}) {
         // Get the isDraggable property without passing it on to the BaseIcon:
-        const appIconParams = Params.parse(iconParams, {isDraggable: true}, true);
-        const isDraggable = appIconParams['isDraggable'];
+        const isDraggable = iconParams['isDraggable'] ?? true;
         delete iconParams['isDraggable'];
-        const expandTitleOnHover = appIconParams['expandTitleOnHover'];
+        const expandTitleOnHover = iconParams['expandTitleOnHover'];
         delete iconParams['expandTitleOnHover'];
 
         super._init({style_class: 'overview-tile'}, isDraggable, expandTitleOnHover);
index 703316f5fb9f1a656eb4bb75a30b11fb3cd41657..1f68a1c54d854a4e790cdad7d7d75a7a21d7921c 100644 (file)
@@ -9,7 +9,6 @@ import Shell from 'gi://Shell';
 import * as Config from '../misc/config.js';
 import * as Main from './main.js';
 import * as MessageTray from './messageTray.js';
-import * as Params from '../misc/params.js';
 
 import {loadInterfaceXML} from '../misc/fileUtils.js';
 import {NotificationErrors, NotificationError} from '../misc/dbusErrors.js';
@@ -128,7 +127,7 @@ class FdoNotificationDaemon {
             hints[hint] = hints[hint].deepUnpack();
         }
 
-        hints = Params.parse(hints, {urgency: Urgency.NORMAL}, true);
+        hints = {urgency: Urgency.NORMAL, ...hints};
 
         // Be compatible with the various hints for image data and image path
         // 'image-data' and 'image-path' are the latest name of these hints, introduced in 1.2
index 49c557b3a8d2d03943063554d9d3ff6c2e7317f5..ef5144a50357a80ddd56b9e0a48bd7842a2309b8 100644 (file)
@@ -6,19 +6,17 @@ import GObject from 'gi://GObject';
 import St from 'gi://St';
 
 import * as Main from './main.js';
-import * as Params from '../misc/params.js';
 import * as PopupMenu from './popupMenu.js';
 
 export const ButtonBox = GObject.registerClass(
 class ButtonBox extends St.Widget {
     _init(params) {
-        params = Params.parse(params, {
+        super._init({
             style_class: 'panel-button',
             x_expand: true,
             y_expand: true,
-        }, true);
-
-        super._init(params);
+            ...params,
+        });
 
         this._delegate = this;